home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Diamond Collection
/
The Diamond Collection (Software Vault)(Digital Impact).ISO
/
cdr45
/
mdidmo.zip
/
MDILOGO.FRM
< prev
next >
Wrap
Text File
|
1994-04-12
|
7KB
|
242 lines
VERSION 2.00
Begin MDIForm frmMain
Caption = "MDI Background Demo"
ClientHeight = 5190
ClientLeft = 1095
ClientTop = 1770
ClientWidth = 9210
Height = 5880
Left = 1035
LinkTopic = "MDIForm1"
Top = 1140
Width = 9330
Begin SSPanel pStatus
Align = 2 'Align Bottom
BevelInner = 1 'Inset
Caption = "pStatus"
Font3D = 3 'Inset w/light shading
Height = 405
Left = 0
TabIndex = 9
Top = 4785
Width = 9210
End
Begin SSPanel Panel3D1
Align = 1 'Align Top
Height = 525
Left = 0
TabIndex = 8
Top = 0
Width = 9210
Begin OptionButton FocusTrap
BackColor = &H00C0C0C0&
Caption = "Option1"
Height = 255
Left = 8820
TabIndex = 0
Top = 150
Value = -1 'True
Width = 225
End
Begin CommandButton cButton
Caption = "Show All"
Height = 345
Index = 5
Left = 6150
TabIndex = 6
Tag = "Unhide all ""hidden"" child document forms"
Top = 90
Width = 1215
End
Begin CommandButton cButton
Caption = "Vertical"
Height = 345
Index = 4
Left = 4950
TabIndex = 5
Tag = "Tile vertically all ""visible"" document child forms"
Top = 90
Width = 1215
End
Begin CommandButton cButton
Caption = "Exit"
Height = 345
Index = 6
Left = 7350
TabIndex = 7
Tag = "Exit demonstration"
Top = 90
Width = 1215
End
Begin CommandButton cButton
Caption = "Horizontal"
Height = 345
Index = 3
Left = 3750
TabIndex = 4
Tag = "Tile horizontally all ""visible"" document child forms"
Top = 90
Width = 1215
End
Begin CommandButton cButton
Caption = "Cascade"
Height = 345
Index = 2
Left = 2550
TabIndex = 3
Tag = "Cascade all ""visible"" child document forms"
Top = 90
Width = 1215
End
Begin CommandButton cButton
Caption = "New"
Height = 345
Index = 1
Left = 1350
TabIndex = 2
Tag = "Create new instance of document child form"
Top = 90
Width = 1215
End
Begin CommandButton cButton
Caption = "Background"
Height = 345
Index = 0
Left = 150
TabIndex = 1
Tag = "Toggle between MDI backgrounds"
Top = 90
Width = 1215
End
End
Begin Menu mMain
Caption = "&Parent Menu"
Begin Menu mTest
Caption = "E&xit"
End
End
End
'---------------------------------------------------------------------------
' MDI Background Demo Program, Copyright (c) 1994 Karl E. Peterson
' Redistributed by permission. CompuServe: 72302,3707
' See MDILOGO.BAS for complete description
'---------------------------------------------------------------------------
'Default behavior
DefInt A-Z
Option Explicit
'Index into toolbar buttons
Const bBackground = 0
Const bNew = 1
Const bCascade = 2
Const bHorz = 3
Const bVert = 4
Const bShow = 5
Const bExit = 6
Sub cButton_Click (Index As Integer)
FocusTrap.SetFocus
Select Case Index
Case bBackground
'Increment current background
frmLogo!HiddenSwitch = Val(frmLogo!HiddenSwitch) + 1
Case bNew
mdiNew
Case bCascade
mdiArrange WM_MDICASCADE
Case bHorz
mdiArrange MDITILE_HORIZONTAL
Case bVert
mdiArrange MDITILE_VERTICAL
Case bShow
mdiShowAll
Case bExit
mdiShowAll
Unload Me
End Select
End Sub
Sub cButton_MouseMove (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
'Update status bar
DisplayStatus (cButton(Index).Tag)
End Sub
Sub MDIForm_Load ()
'Position form on screen, use 640x480 as target dims
Dim newWidth%, newHeight%
newWidth = 640 * Screen.TwipsPerPixelX
If Screen.Height > 480 * Screen.TwipsPerPixelY Then
newHeight = 480 * Screen.TwipsPerPixelY
Else
newHeight = .9 * Screen.Height
End If
Move (Screen.Width - newWidth) \ 2, (Screen.Height - newHeight) \ 2, newWidth, newHeight
FocusTrap.Move FocusTrap.Width * -3
'Set up child arrays
ReDim fDoc(1) 'array of child forms
ReDim fState(1) 'array to track child state
'Create first child, position it, and clear status bar
mdiNew
cButton_Click bCascade
DisplayStatus ""
End Sub
Sub MDIForm_Resize ()
If Me.WindowState <> MINIMIZED Then
'rearrange icons
mdiArrange WM_MDIICONARRANGE
'Reposition background form
Dim cWnd%, R As Rect
cWnd = GetWindow(Me.hWnd, GW_CHILD)
Call GetClientRect(cWnd, R)
frmLogo.Move 0, 0, R.Right * Screen.TwipsPerPixelX, R.Bottom * Screen.TwipsPerPixelY
'Dim hFluff%, wFluff%
'hFluff = (2 * GetSystemMetrics(SM_CYFRAME) + GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYBORDER) + GetSystemMetrics(SM_CYMENU)) * Screen.TwipsPerPixelY
'wFluff = GetSystemMetrics(SM_CXFRAME) * 2 * Screen.TwipsPerPixelX
'frmLogo.Move 0, 0, Me.Width - wFluff, Me.Height - hFluff
End If
End Sub
Sub MDIForm_Unload (Cancel As Integer)
Dim i%, Ret%
For i = Forms.Count - 1 To 0 Step -1
If Forms(i) Is Me Then
'do nothing
Else
'If IsWindowVisible(Forms(i).hWnd) = False Then
' Ret% = ShowWindow(fDoc(i).hWnd, SW_SHOWNA)
'End If
Unload Forms(i)
End If
Next i
End Sub
Sub mTest_Click ()
'This routine will *never* be called!
Unload Me
End Sub
Sub Panel3D1_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
'Update status bar
DisplayStatus ""
End Sub